package com.showsu.editor.utils.aliyun.moderaction;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author edison
 */

@Getter
@AllArgsConstructor
public enum AliyunTextModerationPlusServiceCodeEnum {

    llm_query_moderation("llm_query_moderation", "大语言模型输入文字检测"),
    llm_response_moderation("llm_response_moderation", "大语言模型生成文字检测"),
    comment_detection_pro("comment_detection_pro", "公聊评论内容检测_专业版"),
    nickname_detection_pro("nickname_detection_pro", "用户昵称检测_专业版"),
    chat_detection_pro("chat_detection_pro", "私聊互动内容检测_专业版"),
    ;

    /**
     * 错误码
     */
    final String code;

    /**
     * 错误描述
     */
    final String msg;

    public static AliyunTextModerationPlusServiceCodeEnum getByCode(String code) {
        for(AliyunTextModerationPlusServiceCodeEnum serviceCodeEnum : AliyunTextModerationPlusServiceCodeEnum.values()) {
            if (serviceCodeEnum.getCode().equals(code)){
                return serviceCodeEnum;
            }
        }
        return AliyunTextModerationPlusServiceCodeEnum.comment_detection_pro;
    }
}
